package com.axxc.jpa.task.rabbitmsg.receiver;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.axxc.jpa.entity.StudentEntity;

/**
 * @ClassName: RabbitMqReceiver
 * @Description: 消息消费者A 与 消息消费者B 分别均匀消费 队列(string_msg_queue) 中的消息
 *               多生产者一样,生产到相同的队列,分别均匀消费
 * @author xxc
 * @date 2018年8月3日 下午3:33:38
 * @see http://47.98.248.215:15672/#/
 */
@Component
@RabbitListener(queues = "hello")
public class RabbitMqStringMsgReceiverA {

	@RabbitHandler
	public void processA(String msg) {
		StudentEntity e = JSONObject.parseObject(msg, StudentEntity.class);
		
		System.out.println(e.toString());
		System.out.println("Receiver-消费者A  : " + msg);
	}
}
